import request from '../request'

const Api = {
  homeRecommendation: '/api/sys/eic/homeRecommendation',
  screeningSimulationExperiments: '/api/sys/eic/screeningSimulationExperiments',
  detailsOfIndividualExperiments: '/api/sys/eic/detailsOfIndividualExperiments',
  // 项目管控列表（分页）
  page: '/api/sys/eic/page',
  eicSave: '/api/sys/eic/save',
  editCount: '/api/sys/eic/editCount',
  eicEdit: '/api/sys/eic/edit',
  eicRemoveBatch: '/api/sys/eic/removeBatch',
  eicRemove: '/api/sys/eic/remove',


  // 实验空间实验课程
  filtrate: '/api/sys/emj/filtrate',
  getClssify: '/api/sys/emj/getClssify',
  tree: '/api/sys/emj/tree',


//实验空间公告
  getAnnouncementList: '/api/sys/ebc/getAnnouncementList',
  // 实验空间新闻
  getNewsList: '/api/sys/ebc/getNewsList',
  // 查看新闻/公告详情
  viewDetails: '/api/sys/ebc/viewDetails',
  // 新增新闻
  ebcSave: '/api/sys/ebc/save',
  ebcEdit: '/api/sys/ebc/edit',
  ebcRemove: '/api/sys/ebc/remove',
  ebcRemoveBatch: '/api/sys/ebc/removeBatch',
}

/** 首页推荐 */
export const homeRecommendation = data => {
  return request.request({
    url: Api.homeRecommendation,
    params: data,
    method: 'get'
  })
}
export const getAnnouncementList = data => {
  return request.request({
    url: Api.getAnnouncementList,
    params: data,
    method: 'get'
  })
}
/**条件筛选仿真实验*/
export const screeningSimulationExperiments = data => {
  return request.request({
    url: Api.screeningSimulationExperiments,
    params: data,
    method: 'get'
  })
}
/**查询单个实验详情*/
export const detailsOfIndividualExperiments = data => {
  return request.request({
    url: Api.detailsOfIndividualExperiments,
    params: data,
    method: 'get'
  })
}
/** 筛选条件一级 */
export const filtrate = data => {
  return request.request({
    url: Api.filtrate,
    params: data,
    method: 'get'
  })
}
/** 筛选条件二级 */
export const getClssify = data => {
  return request.request({
    url: Api.getClssify,
    params: data,
    method: 'get'
  })
}
/** 获取新闻列表 */
export const getNewsList = data => {
  return request.request({
    url: Api.getNewsList,
    params: data,
    method: 'get'
  })
}
/** 查看新闻/公告详情 */
export const viewDetails = data => {
  return request.request({
    url: Api.viewDetails,
    params: data,
    method: 'get'
  })
}


// 管理---
//项目管控列表
export const page = data => {
  return request.request({
    url: Api.page,
    params: data,
    method: 'GET'
  })
}
/** 专业树 */
export const tree = data => {
  return request.request({
    url: Api.tree,
    params: data,
    method: 'get'
  })
}
/** 新增虚仿 */
export const eicSave = data => {
  return request.request({
    url: Api.eicSave,
    data: data,
    method: 'POST'
  })
}
/** 修改虚仿 */
export const eicEdit = data => {
  return request.request({
    url: Api.eicEdit,
    data: data,
    method: 'Put'
  })
}
/** 修改虚仿 */
export const editCount = data => {
  return request.request({
    url: Api.editCount,
    data: data,
    method: 'Put'
  })
}
/** 删除虚仿项目 */
export const eicRemove = data => {
  return request.request({
    url: Api.eicRemove,
    params: data,
    method: 'DELETE'
  })
}

/** 批量删除虚仿项目 */
export const eicRemoveBatch = data => {
  return request.request({
    url: Api.eicRemoveBatch,
    params: data,
    method: 'DELETE'
  })
}
// 新闻
// 新增新闻
export const ebcSave = data => {
  return request.request({
    url: Api.ebcSave,
    data: data,
    method: 'POST'
  })
}
// 修改新闻
export const ebcEdit = data => {
  return request.request({
    url: Api.ebcEdit,
    data: data,
    method: 'Put'
  })
}
/** 删除新闻/公告 */
export const ebcRemove = data => {
  return request.request({
    url: Api.ebcRemove,
    params: data,
    method: 'DELETE'
  })
}

/** 批量删除新闻/公告 */
export const ebcRemoveBatch = data => {
  return request.request({
    url: Api.ebcRemoveBatch,
    params: data,
    method: 'DELETE'
  })
}
